﻿using System.Xml;

namespace TestUp.Models.TestWorkers.FileToXmlParsers
{
    public abstract class BaseTestFileParser :ITestFileParser
    {
        public XmlDocument Parse(object data)
        {
            var xmlDocument = ParseFile(data);
            if (XmlTestValidator.Validate(xmlDocument))
                return xmlDocument;
            return null;
        }

        protected abstract XmlDocument ParseFile(object data);
    }
}